#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>

#define flr(x,l,r) for (int x = l; x <= r; ++ x)
#define frl(x,r,l) for (int x = r; x >= l; -- x)
#define LL long long 
#define mt memset 
#define szf sizeof
#define in(x) scanf("%d", &x)
#define out(x) printf("%d", x)
#define inll(x) scanf("%lld", &x)
#define outll(x) printf("%lld", x)
#define pn printf("\n")
#define con continue
#define bk break
#define vc vector 
#define pb push_back
#define sz size
#define PII pair<int, int>

using namespace std;

const int N = 3e5 + 10;

int n, s;
LL t[N], c[N], f[N];
int q[N];

int main() {
    in(n), in(s);

    flr (i, 1, n) {
        inll(t[i]), inll(c[i]);
        t[i] += t[i - 1], c[i] += c[i - 1];
    }

    int hh = 0, tt = 0;
    flr (i, 1, n) {
        int l = hh, r = tt;
        while (l < r) {
            int mid = l + r >> 1;
            if (f[q[mid + 1]] - f[q[mid]] > (t[i] + s) * 
                (c[q[mid + 1]] - c[q[mid]])) r = mid;
            else l = mid + 1;
        }

        int j = q[r];
        f[i] = f[j] - (t[i] + s) * c[j] + t[i] * c[i] + s * c[n];
        while (hh < tt && (double)(f[q[tt]] - f[q[tt - 1]]) * 
            (c[i] - c[q[tt]]) >= (double)(f[i] - f[q[tt]]) * 
            (c[q[tt]] - c[q[tt - 1]])) tt -- ;
        q[ ++ tt] = i;
    }

    outll(f[n]), pn;

    return 0;
}